package com.itheima.test32;

import java.util.Random;
import java.util.TreeSet;

/*
	3.2 双色球规则，双色球每注投注号码由6个1—33的号码和1个1—16的号码组成。其中6个1-33的数字要求不能重复。请用集合完成随机生成一注双色球号码。
	                                        red             blue
 */
public class Test32 {
    public static void main(String[] args) {
        TreeSet<Integer> redBall = new TreeSet<>();
        TreeSet<Integer> blueBall = new TreeSet<>();

        Random random = new Random();
        int blueRand = random.nextInt(16) + 1;

        while (redBall.size() != 6){
            int redRand = random.nextInt(33) + 1;
            redBall.add(redRand);
        }

        blueBall.add(blueRand);

        System.out.println(redBall);
        System.out.println(blueBall);
    }
}
